import java.util.List;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.ac.dao.impl.HibernateBaseDaoImpl;
import com.ac.entity.Customer;


public class TestHibernateVersion {

	public static void main(String[] args) {
        BeanFactory factory=new ClassPathXmlApplicationContext("file:C:/Users/enfuzion/workspace/orderTracking/WebRoot/WEB-INF/applicationContext.xml");
        HibernateBaseDaoImpl  td=(HibernateBaseDaoImpl) factory.getBean("hibernateBaseDao");
        System.out.println(td.toString());
        List list = td.getAllList(Customer.class);
        
        System.out.println("list size >>>>>>>>>>>>>>>>>>>>>>>>> " +  list.size());
        
        Customer c1 = (Customer)list.get(0);
        
        List list2 = td.getAllList(Customer.class);
        
        System.out.println("list2 size >>>>>>>>>>>>>>>>>>>>>>>>> " +  list2.size());
        Customer c2 = (Customer)list2.get(0);
        
        c1.setName("321");
        td.saveOrUpdate(c1);
        c2.setName("321");
        td.saveOrUpdate(c2);
        
//        Customer c = new Customer();
//        c.setName("123");
        
//        td.saveOrUpdate(c);
//        Tiger tiger=new Tiger();
//        tiger.setId(10);
//        tiger.setName("lisi");
//        Tiger tiger2=new Tiger();
//        tiger2.setId(11);
//        tiger2.setName("wangwu");
//        td.save2(tiger, tiger2);
    }
}
